//
//  OrderManagerTableViewCell.m
//  BusinessApp
//
//  Created by macox on 16/10/17.
//  Copyright © 2016年 macox. All rights reserved.
//

#import "OrderManagerTableViewCell.h"
//@property (weak, nonatomic) IBOutlet UILabel *OrderLabel;
//@property (weak, nonatomic) IBOutlet UILabel *OrderState;
//@property (weak, nonatomic) IBOutlet UILabel *UserName;
//@property (weak, nonatomic) IBOutlet UILabel *Price;
//@property (weak, nonatomic) IBOutlet UIButton *StateBtn;
//@property (weak, nonatomic) IBOutlet UILabel *DateTimeLabel;

@implementation OrderManagerTableViewCell
- (void)setModel:(OrderManagerModel *)model{
    _OrderLabel.text = [NSString stringWithFormat:@"订单编号  %@",model.OrderCode];
    _OrderState.text = model.OrderStatues;
    _UserName.text = [NSString stringWithFormat:@"买家昵称:%@",model.UserName];
    _DateTimeLabel.text = [NSString stringWithFormat:@"下单时间:%@",model.OrderDate];
    _Price.text =[NSString stringWithFormat:@"金额:%.2f元",model.OrderTotalAmount.doubleValue];
//    if ([model.OrderStatues isEqualToString:@"待付款"]) {
//        _StateBtn.backgroundColor = [UIColor whiteColor];
//        [_StateBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    }
    if ([model.OrderStatues isEqualToString:@"待发货"]) {
        [_StateBtn setTitle:@"发货" forState:UIControlStateNormal];
        _StateBtn.backgroundColor = [UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00];
    } else if ([model.OrderStatues isEqualToString:@"待收货"]) {
        [_StateBtn setTitle:@"送达" forState:UIControlStateNormal];
        _StateBtn.backgroundColor = [UIColor colorWithRed:0.45 green:0.75 blue:0.19 alpha:1.00];
    }else {
        _StateBtn.backgroundColor = [UIColor whiteColor];
        [_StateBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    }
    _state = model.OrderStatues;
    _proID = model.Id;
}
- (IBAction)SenderBtn:(id)sender {
    [self.delegate orderManagerTrun:_proID :_state];
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
